package com.group6.controller;


import com.group6.entity.Medicine;
import com.group6.service.DoctorService;
import com.group6.service.MedicineService;
import com.group6.vo.MedicineVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/Medicine")
public class MedicineController {

    @Resource
    private MedicineService medicineService;

    @RequestMapping("/MedicineAdd")
    public String MedicineAdd(@RequestBody MedicineVo medicineVo)
    {
        return medicineService.MedicineAdd(medicineVo);
    }

    @RequestMapping("/MedicineUpdate")
    public String MedicineUpdate(@RequestBody Medicine medicine)
    {
        return medicineService.MedicineUpdate(medicine);
    }

    @RequestMapping("/MedicineList")
    public String MedicineList()
    {
        return medicineService.MedicineList().toString();
    }

    @RequestMapping("/MedicineDelete")
    public String MedicineDelete(@RequestBody Medicine medicine)
    {
        return medicineService.MedicineDelete(medicine);
    }



}
